package com.libbase.kotlin

import com.chan.net.Result
import com.libbase.bean.NyqfBean
import com.libbase.http.Http
import com.libbase.http.cancelTag
import com.libbase.kotlin.presenter.NewContract
import com.libbase.kotlin.presenter.NyqfContract
import io.reactivex.Flowable

class NewModel : NewContract.Model {
    override fun destroy() {
        cancelTag("raw/master/nyqf_data.json")
    }

    override fun getNews(nav: String): Flowable<Result<NyqfBean>> {
        return getHttp().getNews(nav)
    }

    override fun getHttp(): NyqfContract.Api {
        return Http.getNyqfRetrofit(NyqfContract.Api::class.java)
    }

}